#define _CRT_SECURE_NO_WARNINGS 1

//#include<iostream>
//
//using namespace std;
//
//double PI = 3.1415926535897932;
//
//int main()
//{
//    int r;
//    cin >> r;
//    double per = (r + 3) * 2 * PI;
//    double area = ((r + 3) * (r + 3) - (r * r)) * PI;
//
//    printf("Fencing Cost is $%.2lf\n", per * 35);
//    printf("Concrete Cost is $%.2lf\n", area * 20);
//
//    return 0;
//}


#include<iostream>

using namespace std;

class Fenshu 
{
public:
	Fenshu(int fz, int fm)
	{
		_fz = fz;
		_fm = fm;
	}

	Fenshu add(Fenshu other)
	{
		int resultFm = _fm * other._fm;
		int resultFz = _fz * other._fm + _fm * other._fz;
		Fenshu result(resultFz,resultFm);
		return result;
	}

	Fenshu sub(Fenshu other)
	{
		int resultFm = _fm * other._fm;
		int resultFz = _fz * other._fm - _fm * other._fz;
		Fenshu result(resultFz, resultFm);
		return result;
	}
	int den(int a, int b)
	{
		int m = a;
		int n = b;
		int r = m;
		while (r != 0)
		{
			m = n;
			n = r;
			r = m % n;
		}
		return n;
	}

	void Print()
	{
		if (_fz % _fm == 0)
		{
			cout << (_fz / _fm) << endl;
		}
		else
		{
			int a = abs(_fz);
			int b = abs(_fm);
			int s = den(a, b);
			a = a / s;
			b = b / s;
			if (_fz * _fm < 0)
			{
				cout << "-" << a << "/" << b << endl;
			}
			else
			{
				cout << a << "/" << b << endl;
			}
		}
	}
private:
	int _fz;
	int _fm;
};

int main()
{
	string s;
	while (cin>>s)
	{

		int a = s[0] - '0', b = s[2] - '0', c = s[4] - '0', d = s[6] - '0';
		char way = s[3];
		Fenshu first(a, b);
		Fenshu second(c, d);
		if (way == '+')
		{
			Fenshu ret = first.add(second);
			ret.Print();
		}
		else
		{
			Fenshu ret = first.sub(second);
			ret.Print();
		}
	}

	return 0;
}